bind: update conffiles list
authorDavid Härdeman <[email protected]>
Sun, 27 Jul 2025 01:50:50 +0000 (03:50 +0200)
committerNoah Meyerhans <[email protected]>
Sat, 13 Sep 2025 20:36:41 +0000 (13:36 -0700)
The previous patches removed a number of conffiles that weren't necessary,
meaning we can now assume that any changes or additional files in /etc/bind
are things that the user wants to keep.

Since /var/lib/bind is the standard location for longer-lived zone data
(i.e. not zones that secondary servers have obtained via XFER), we symlink
it to /etc/bind/zones so that it survives a sysupgrade.

Temporary files (such as XFER:ed zones for secondaries) stay in
/var/cache/bind.

Signed-off-by: David Härdeman <[email protected]>
net/bind/Makefile
net/bind/files/bind/named.conf
net/bind/files/named.init

index f9d73b70244139eb9705bb8b0b3725286d1de965..8db0e335a8b56adddb42c00c932160d2d64a3a06 100644 (file)
@@ -229,8 +229,7 @@ define Package/bind-server/install
 endef
 
 define Package/bind-server/conffiles
-/etc/bind/db.root
-/etc/bind/named.conf
+/etc/bind
 endef
 
 define Package/bind-server-filter-aaaa/install
index 93798ea83b16084ffba3d1e7752ac8ceaa3f252d..dd44932c9619b9dcd488a2268debe04437c52094 100644 (file)
@@ -1,6 +1,8 @@
 // This is the primary configuration file for the BIND DNS server named.
 
 options {
+       // Default directory for ephemeral zones, long-lived zones
+       // can be stored under /var/lib/bind (aka /etc/bind/zones)
        directory "/var/cache/bind";
 };
 
index aa57e09e2dcfaa8f40804b7780b6c82ceac18c63..7f09bf6b510d6d84d89005c13f8ac96790b294cf 100644 (file)
@@ -11,8 +11,8 @@ config_dir=/etc/bind
 run_dir=/var/run/named
 log_dir=/var/log/named
 cache_dir=/var/cache/bind
+zone_dir=$config_dir/zones
 lib_dir=/var/lib/bind
-dyn_dir=/tmp/bind
 
 config_file=$config_dir/named.conf
 config_local_file=$dyn_dir/named.conf.local
@@ -25,7 +25,7 @@ start_service() {
        user_exists bind 57 || user_add bind 57
        group_exists bind 57 || group_add bind 57
 
-       for dir in $run_dir $log_dir $cache_dir $lib_dir $dyn_dir; do
+       for dir in $run_dir $log_dir $cache_dir $zone_dir; do
                if [ ! -e "$dir" ]; then
                        mkdir -p "$dir"
                fi
@@ -33,6 +33,11 @@ start_service() {
                chmod 0775 "$dir"
        done
 
+       if [ ! -e $lib_dir ]; then
+               mkdir -p $(dirname $lib_dir)
+               ln -sf $zone_dir $lib_dir
+       fi
+
        if [ ! -s /etc/bind/rndc.key ] && [ ! -s /etc/bind/rndc.conf ]; then
                rndc-confgen -a
                chown bind:bind /etc/bind/rndc.key